package models;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.UniqueConstraint;

import play.data.validation.MaxSize;
import play.data.validation.Required;
import play.db.jpa.GenericModel;
import play.db.jpa.Model;

@Entity
public class Tag extends GenericModel {

	@Id
	@MaxSize(40)
	public String name;
	
	@MaxSize(255)
	public String description;

	@ManyToOne
	public TagCategory category;

	@Override
	public String toString() {
		return name;
	}
	
	public Tag(String name) {
		super();
		this.name = name;
	}
	
	public Tag(String name, String description) {
		super();
		this.name = name;
		this.description = description;
	}
}
